package com.white.server.impl;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) {
        try {
            ServerSocket serverSocket = new ServerSocket(8080);
            /*一直运行，等待程序响应*/
            System.out.println("服务器运行中...");
            while (true) {
                Socket clientSocket = serverSocket.accept();
                new Thread(new ServerSend(clientSocket)).start();
                new Thread(new ServerListen(clientSocket)).start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
